/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "titulares", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Titulares.findAll", query = "SELECT t FROM Titulares t"),
    @NamedQuery(name = "Titulares.findByIdtitulares", query = "SELECT t FROM Titulares t WHERE t.idtitulares = :idtitulares"),
    @NamedQuery(name = "Titulares.findByTitNombre", query = "SELECT t FROM Titulares t WHERE t.titNombre = :titNombre"),
    @NamedQuery(name = "Titulares.findByTitApe", query = "SELECT t FROM Titulares t WHERE t.titApe = :titApe"),
    @NamedQuery(name = "Titulares.findByTitDire", query = "SELECT t FROM Titulares t WHERE t.titDire = :titDire"),
    @NamedQuery(name = "Titulares.findByTitTelf", query = "SELECT t FROM Titulares t WHERE t.titTelf = :titTelf"),
    @NamedQuery(name = "Titulares.findByEmail", query = "SELECT t FROM Titulares t WHERE t.email = :email")})
public class Titulares implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idtitulares", nullable = false)
    private Integer idtitulares;
    @Column(name = "tit_nombre")
    private Integer titNombre;
    @Column(name = "tit_ape")
    private Integer titApe;
    @Column(name = "tit_dire")
    private Integer titDire;
    @Column(name = "tit_telf")
    private Integer titTelf;
    @Column(name = "email")
    private Integer email;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idtitulares")
    private Collection<CtasTitular> ctasTitularCollection;

    public Titulares() {
    }

    public Titulares(Integer idtitulares) {
        this.idtitulares = idtitulares;
    }

    public Integer getIdtitulares() {
        return idtitulares;
    }

    public void setIdtitulares(Integer idtitulares) {
        this.idtitulares = idtitulares;
    }

    public Integer getTitNombre() {
        return titNombre;
    }

    public void setTitNombre(Integer titNombre) {
        this.titNombre = titNombre;
    }

    public Integer getTitApe() {
        return titApe;
    }

    public void setTitApe(Integer titApe) {
        this.titApe = titApe;
    }

    public Integer getTitDire() {
        return titDire;
    }

    public void setTitDire(Integer titDire) {
        this.titDire = titDire;
    }

    public Integer getTitTelf() {
        return titTelf;
    }

    public void setTitTelf(Integer titTelf) {
        this.titTelf = titTelf;
    }

    public Integer getEmail() {
        return email;
    }

    public void setEmail(Integer email) {
        this.email = email;
    }

    @XmlTransient
    public Collection<CtasTitular> getCtasTitularCollection() {
        return ctasTitularCollection;
    }

    public void setCtasTitularCollection(Collection<CtasTitular> ctasTitularCollection) {
        this.ctasTitularCollection = ctasTitularCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtitulares != null ? idtitulares.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Titulares)) {
            return false;
        }
        Titulares other = (Titulares) object;
        if ((this.idtitulares == null && other.idtitulares != null) || (this.idtitulares != null && !this.idtitulares.equals(other.idtitulares))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Titulares[ idtitulares=" + idtitulares + " ]";
    }
    
}
